package com.dp.mallchat.common.common.utils.discover;

import org.jsoup.nodes.Document;

/**
 * @Author: dupeng
 * @CreateTime: 2024-07-15  19:59
 * @Description: TODO
 */
public class WxUrlDiscover extends AbstractUrlDiscover{
    @Override
    public String getTitle(Document document) {
        return document.getElementsByAttributeValue("property", "og:title").attr("content");
    }

    @Override
    public String getDescription(Document document) {
        return document.getElementsByAttributeValue("property", "og:description").attr("content");
    }

    @Override
    public String getImage(String url, Document document) {
        String href = document.getElementsByAttributeValue("property", "og:image").attr("content");
        return isConnect(href) ? href : null;
    }
}
